//
//  ForgetPasswordViewModel.m
//  bus
//
//  Created by hychen on 2017/4/6.
//  Copyright © 2017年 Hychen. All rights reserved.
//

#import "ForgetPasswordViewModel.h"

@implementation ForgetPasswordViewModel

- (void)requestForgetPasswordDataWithParams:(NSArray *)param success:(NetWorkSuccessBlock)success failure:(NetWorkFailureBlock)failure{
    
//    NSArray *array = @[param.firstObject,@{@"user_number":param[1],@"validcode":param[2],@"password":param[3]}];
    
    [[NetworkTool sharedNetworkTool] requestDataWithParams:@[param.firstObject,param[1],param[2],param[3]] authType:AUTH_DEFAULT dataType:JSON_ITEM Success:^(id obj) {
        if (success) {
            success(nil);
        }
    } Failure:^(NSString *code, NSString *msg) {
        if (failure) {
            failure(code,msg);
        }
    }];
    
//    [[NetworkTool sharedNetworkTool] requestJavaBeanDataWithParams:array authType:AUTH_DEFAULT dataType:JSON_ITEM Success:^(id obj) {
//        success(nil);
//    } Failure:^(NSString *code, NSString *msg) {
//        if (failure) {
//            failure(code,msg);
//        }
//    }];
}

- (void)requestValidCodeWithPhone:(NSString *)phone success:(NetWorkSuccessBlock)success failure:(NetWorkFailureBlock)failure{
    
    [[NetworkTool sharedNetworkTool] requestValidCodeWithPhoneNum:phone type:@"1" Success:^(id obj) {
        success(obj);
    } Failure:^(NSString *code, NSString *msg) {
        if (failure) {
            failure(code,msg);
        }
    }];
}
@end
